# coding:utf-8
import requests
import json
import sys
from common import common

def sysPost(url):
    dict1={'content-type': 'application/json'}
    dict2={}

    times=common.get_local_time_pattern_data()
    num=common.get_random_data(1,100)
    username='test'+str(times)+str(num)
    print username
    email=common.get_random_data(1,10000000000000)
    print email
    ids=common.get_random_data(1,100000000)
    print ids
    creattime=common.get_local_time_pattern_date()

    dict2['account']=username
    dict2['address']='北京市'
    dict2['concurrency']=0
    dict2['contact']='string'
    dict2['email']=email
    dict2['id']=ids
    dict2['ip']='172.19.36.53'
    dict2['memberMax']=50
    dict2['mobile']='238320'
    dict2['name']='yif'
    dict2['password']='123456'
    dict2['status']=0
    dict2['sysCreated']=creattime
    dict2['sysLastmodified']=creattime
    dict2['tel']='370480'
    dict2['type']='wew'

    r=requests.post(url,headers=dict1,data=json.dumps(dict2))
    return dict2,r

# def sysGetParaInUrl():

def sysGet(url,ids):
    urls=url+'/'+str(ids)
    r=requests.get(urls)
    return r

if __name__ =='__main__':
    unittest.main()

